#include "Generate_C_std.h"
class Pattern_pre_op : public Pattern
{
public:
	bool match(Statement* that)
	{
		op = new Wildcard<OP>;
		var = new Wildcard<VARIABLE_NAME>;
		return(that->match(new Pre_op(op, var)));
	}

	void generate_code(Generate_C* gen)
	{
		assert (op_functions.has (*op->value->value));

		string op_fn = op_functions[*op->value->value]; 

		INST (buf, "pre_op",
			var->value, s(op_fn));
	}

protected:
	Wildcard<VARIABLE_NAME>* var;
	Wildcard<OP>* op;
};

CREATE(Pattern_pre_op)
